package com.landscope.issue.controller.wx;

import com.landscope.issue.controller.base.ResponseResult;
import com.landscope.issue.controller.wx.dto.AppletMessageListDto;
import com.landscope.issue.controller.wx.dto.AppletStationListDto;
import com.landscope.issue.controller.wx.dto.AppletStationViewDto;
import com.landscope.issue.controller.wx.param.AppletMessageListParam;
import com.landscope.issue.controller.wx.param.AppletStationListParam;
import com.landscope.issue.controller.wx.param.AppletStationViewParam;
import com.landscope.issue.service.applet.ApiAppletMessageService;
import com.landscope.issue.service.applet.ApiAppletStationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RequestMapping("api/applet/message")
@RestController
@Api(tags = "9.小程序-系统通知")
@CrossOrigin
public class ApiAppletMessageController {

    @Resource
    private ApiAppletMessageService apiAppletMessageService;

    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", name = "token", value = "token", dataType = "String")
    })
    @ApiOperation(value = "9.1 获取消息列表",notes = "获取消息列表")
    @PostMapping("/list")
    public ResponseResult<AppletMessageListDto> list(@RequestBody AppletMessageListParam param){
        return apiAppletMessageService.list(param);
    }

    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", name = "token", value = "token", dataType = "String")
    })
    @ApiOperation(value = "9.2 清除未读",notes = "清除未读")
    @PostMapping("/read")
    public ResponseResult read(@RequestBody AppletMessageListParam param){
        return apiAppletMessageService.read(param);
    }
}
